﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Agent_Assignment
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        ObservableCollection<Agent> agents = new ObservableCollection<Agent>();
        public MainWindow()
        {
            InitializeComponent();
            agents.Add(new Agent("1337", "Lorte Hans", "Lortevej", "Trolling", "Troll"));
            agents.Add(new Agent("666", "Satan", "Hell", "Vildledelse", "Dark Lord"));
            
            Binding bindName1 = new Binding();
            bindName1.Source = agents;
            bindName1.Path = new PropertyPath("ID");
            textBox1.SetBinding(TextBox.TextProperty, bindName1);

            Binding bindName2 = new Binding();
            bindName2.Source = agents;
            bindName2.Path = new PropertyPath("CodeName");
            textBox2.SetBinding(TextBox.TextProperty, bindName2);

            Binding bindName3 = new Binding();
            bindName3.Source = agents;
            bindName3.Path = new PropertyPath("Speciality");
            textBox3.SetBinding(TextBox.TextProperty, bindName3);

            Binding bindName4 = new Binding();
            bindName4.Source = agents;
            bindName4.Path = new PropertyPath("Assignment");
            textBox4.SetBinding(TextBox.TextProperty, bindName4);
        }
    }
}
